<div class="row" ng-controller="myFoodController">
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <form name="form" class="form-validation form-horizontal">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel">{{myFood.id?'修改':'增加'}}上传餐品信息</h4>
                    </div>
                    <div class="modal-body">
                        <!-- 修改-->
                        <div class="row">
                            <div class="col-md-12">
                                <div class="form-group character-counter">
                                    <label class="control-label col-md-2">我的餐品</label>

                                    <div class="col-md-10">
                                        <input type="text" class="form-control" placeholder="请输入餐品名" ng-model="myFood.food"
                                               value="{{myFood.food}}" maxlength="50" required>
                                        <label class="character-counter-label-2"
                                               ng-bind="(myFood.food != undefined ? myFood.food.length : 0)+' / 50'">
                                        </label>
                                    </div>
                                </div>
                                <div class="form-group character-counter">
                                    <label class="control-label col-md-2">餐品价格</label>

                                    <div class="col-md-10">
                                        <input type="text" class="form-control" placeholder="请输入餐品价格" name="price"
                                               ng-model="myFood.price" value="{{myFood.price}}" maxlength="50"
                                               required>
                                        <label class="character-counter-label-2"
                                               ng-bind="(myFood.price != undefined ? myFood.price.length : 0)+' / 50'">
                                        </label>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <!--修改-->
                    </div>
                    <div class="modal-footer">
                        <button class="btn btn-primary" ng-disabled="form.$invalid" ng-click="saveFood()"
                                data-dismiss="modal">提交
                        </button>
                        <button type="button" class="btn btn-primary" data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!-- Modal -->
    <div class="col-md-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h1 class="panel-title">
                    加盟商家上传餐品列表汇总
                </h1>
            </div>
            <div class="panel-body">
                <div class="row">
                    <div class="col-md-12">
                        <table class="table table-hover table-cell table-bordered">
                            <thead>
                            <tr>
                                <th></th>
                                <th>我的上传餐品</th>
                                <th>我的餐品价格</th>
                                <th>管理员审核状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr ng-repeat="myFood in myFoods">
                                <td>{{$index+1}}</td>
                                <td>{{myFood.food}}</td>
                                <td>{{myFood.price}}</td>
                                <td>{{myFood.status | statusFilterManage}}</td>
                                <td>
                                    <button type="button" class="btn btn-primary btn-sm" data-toggle="modal"
                                            data-target="#myModal" ng-click="updateFood(myFood)">
                                        修改
                                    </button>
                                    <button class="btn btn-primary btn-sm" ng-click="deleteFood(myFood.id,myFood.name)">删除
                                    </button>
                                </td>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="panel-footer">
                <button type="button" class="btn btn-info " data-toggle="modal" data-target="#myModal"
                        ng-click="addFood()">上传餐品
                </button>
                <a href="#/businessWelcome" class="btn btn-info">返回首页</a>
            </div>
        </div>
    </div>

</div>
